<div class="map"></div>

<button class="start">开始</button>
<button class="stop">停止</button>

<script src="./snake.js"></script>
<script src="./food.js"></script>
<script src="./map.js"></script>
<script src="./game.js"></script>
<script>
    const g=new Game('.map')

    const start=document.querySelector('.start')
    start.addEventListener('click',()=> g.start())  //点击事件里调用 Game里start 这个方法

    const stop1=document.querySelector('.stop')
    stop1.addEventListener('click',()=> g.stop())
</script>